package com.example.travel.service;

import com.example.travel.mapper.GroupUserMapper;
import com.example.travel.pojo.orm.GroupUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GroupUserService {

    @Autowired
    private GroupUserMapper mapper;

    public List<GroupUser> getAllGroupUser(){
        return mapper.getAllGroupUser();
    }

    public List<GroupUser> getGroupUserByUserId(int userId){
        return mapper.getGroupUserByUserId(userId);
    }

    public List<GroupUser> getGroupUserByGroupId(int groupId){
        return mapper.getGroupUserByGroupId(groupId);
    }

    public int addGroupUser(GroupUser groupUser){
        return mapper.addGroupUser(groupUser);
    }

    public int deleteGroupUserByGroupId(int groupId){
        return mapper.deleteGroupUserByGroupId(groupId);
    }
}
